﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wform4
{

    interface MyInter
    {
        int calc();
        int cc
        {
            get;
            set;
        }
    }
    class MyParentClass
    {
        public virtual int calcParent()
        {
            return 0;
        }
    }

    class myChild :   MyParentClass, MyInter
    {

        public int cc
        {
            get
            {
                throw new NotImplementedException();
            }

            set
            {
                throw new NotImplementedException();
            }
        }

        public int calc()
        {
            return 1;
             
        }

        public override int calcParent()
        {

            Test2(this);

            return base.calcParent();


        }


        public void Test2(MyInter obj)
        {
            obj.calc();

        }

        private int[] aa;

        public int this[int index]
        {
            get
            {
                if(index >=0 &&index < aa.Length )
                {
                    return aa[index];
                }
                else
                {
                    throw new Exception("Overflow");
                }
            }

            set
            {
                if (index >= 0 && index < aa.Length)
                {
                    aa[index] = value;
                }
            }
        }



        

    }
 



}
